import request from "@/utils/request";

// 查询题目练习记录列表
export function listRecord(query) {
  return request({
    url: "/system/record/list",
    method: "get",
    params: query,
  });
}

// 查询题目练习记录详细
export function getRecord(id) {
  return request({
    url: "/system/record/" + id,
    method: "get",
  });
}

// 新增题目练习记录
export function addRecord(data) {
  return request({
    url: "/system/record",
    method: "post",
    data: data,
  });
}

// 修改题目练习记录
export function updateRecord(data) {
  return request({
    url: "/system/record",
    method: "put",
    data: data,
  });
}

// 删除题目练习记录
export function delRecord(id) {
  return request({
    url: "/system/record/" + id,
    method: "delete",
  });
}

/**
 * 根据题目id和学生id查询题目练习记录
 */
export function getRecordByQuestionAndStudent(questionId, studentId) {
  return request({
    url: "/system/record/question/" + questionId + "/student/" + studentId,
    method: "get",
  });
}
